﻿using DH.Core.MapperHelper;
using DH.Core.UI.ViewModel;
using DH.Entity;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace DH.Service.ViewModels
{
    [MapToType(typeof(OrganizeEntity))]
    public class OrganizeViewModel: EntityModelBase
    {
        public string IndexId { get; set; }
        public string ParentId { get; set; }
        public string ParentName { get; set; }
        public int Layers { get; set; }

        /// <summary>
        /// 编码
        /// </summary>
        public string EnCode { get; set; }
        /// <summary>
        /// 全称
        /// </summary>
        public string FullName { get; set; }
        /// <summary>
        /// 简称
        /// </summary>
        
        public string ShortName { get; set; }

        /// <summary>
        /// 分类（公司/部门）
        /// </summary>
        public string CategoryId { get; set; } = "";

        /// <summary>
        /// 负责人
        /// </summary>
        public string ManagerId { get; set; }
        public string TelePhone {
            get {
                if (string.IsNullOrWhiteSpace(_telePhone))
                {
                    return "";
                }
                return _telePhone;
            }
            set
            {
                _telePhone = value;
            }

        }
        private string _telePhone=string.Empty;

        public string MobilePhone { get; set; }
        public string WeChat { get; set; }

        public string Fax { get; set; }

        public string Email { get; set; }

        public string AreaId { get; set; }

        public string Address { get; set; }

        
        public bool AllowEdit { get; set; }

        
        public bool AllowDelete { get; set; }

        
        public bool DeleteMark { get; set; }

        
        public bool EnabledMark { get; set; }



        public string Description { get; set; }

        
        //public DateTimeOffset CreatedOn { get; set; }
        //public string CreatedBy { get; set; }

        
        //public DateTimeOffset UpdatedOn { get; set; }
        //public string UpdatedBy { get; set; }

        //public DateTimeOffset? DeletedOn { get; set; }
        //public string DeletedBy { get; set; }

       
    }
}
